﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using GS.DataConnection;

namespace GS.CMS.Entities
{
    public class FeedBack
    {
        public DataSet GetListFeedBack(int pgNum)
        {
            System.Collections.Hashtable ht = new System.Collections.Hashtable();
            ht.Add("@pgNum", pgNum);
            return SqlProvider.GetDataSet("pro_feedback_list", "dsFeedBack", ht);
        }
        public DataTable GetFeedBackByID(int FeedBackID)
        {
            System.Collections.Hashtable ht = new System.Collections.Hashtable();
            ht.Add("@FeedBackID", FeedBackID);
            return SqlProvider.GetTable("pro_feedBack_get_by_id", "dtFeedBack", ht);
        }
        public int UpdateFeedBackByID(int FeedBackID, string Header, string Summary, string Content, string SenderName, string Email
         )
        {
            System.Collections.Hashtable ht = new System.Collections.Hashtable();
            ht.Add("@FeedBackID", FeedBackID);
            ht.Add("@n_Summary", Summary);
            ht.Add("@n_Header", Header);
            ht.Add("@nt_Content", Content);
            ht.Add("@n_SenderName", SenderName);
            ht.Add("@IsActived", false);
            ht.Add("@Email", Email);
            return int.Parse(SqlProvider.ExecuteScalar("pro_feedback_update", ht).ToString());
        }
    }
}
